home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / basic / qbnws302.zip / QBNWS302.NWS < prev   
Text File  |  1992-06-29  |  44KB  |  1,160 lines

  1.      Volume  3, Number  2                                     June 29, 1992
  2.  
  3.      
  4.      
  5.      
  6.      
  7.      
  8.      
  9.      
  10.      
  11.      
  12.      
  13.      
  14.      
  15.                    **************************************************
  16.                    *                                                *
  17.                    *                    QBNews                      *
  18.                    *                                                *
  19.                    *      International QuickBASIC Electronic       *
  20.                    *                  Newsleter                     *
  21.                    *                                                *
  22.                    *    Dedicated to promoting QuickBASIC around    *
  23.                    *                  the world                     *
  24.                    *                                                *
  25.                    **************************************************
  26.      
  27.      
  28.      
  29.      
  30.      
  31.      
  32.      
  33.      
  34.      
  35.      
  36.      
  37.      
  38.      
  39.      
  40.      
  41.      
  42.         The  QBNews  is  an electronic newsletter  published  by  Clearware
  43.      Computing. It can be freely distributed providing NO CHARGE is charged
  44.      for  distribution.  The  QBNews is copyrighted in  full  by  Clearware
  45.      Computing.  The  authors  hold  the  copyright  to  their   individual
  46.      articles.  All program code appearing in QBNews is released  into  the
  47.      public  domain.   You  may  do what you  wish  with  the  code  except
  48.      copyright  it.  QBNews  must  be  distributed  whole  and  unmodified.
  49.      
  50.      You can write The QBNews at:
  51.      
  52.           The QBNews
  53.           P.O. Box 507
  54.           Sandy Hook, CT 06482
  55.      
  56.      Copyright (c) 1992 by Clearware Computing.
  57.      
  58.      The QBNews                                                   Page    i
  59.      Volume  3, Number  2                                     June 29, 1992
  60.  
  61.      
  62.  
  63.      ----------------------------------------------------------------------
  64.  
  65.                         T A B L E   O F   C O N T E N T S
  66.  
  67.      
  68.      1.  From the Editor's Desk
  69.           Is this Goodbye? .............................................  1
  70.  
  71.      2.  DataBASICs and File I/O
  72.           File Types 100 by Richard Vannoy .............................  2
  73.           Indexing 101 by Richard Vannoy ...............................  5
  74.           Hashing-It isn't all Corned Beef by Dave Cleary and Mike Avery 10
  75.           Create dBASE III Data Files from QuickBASIC by Dennis Gellert  11
  76.           Adding LANtastic Support to your Programs by Chip Morrow ..... 13
  77.           A powerful line editor for QB by Larry Stone ................. 15
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.      The QBNews                                                   Page   ii
  118.      Volume  3, Number  2                                     June 29, 1992
  119.  
  120.  
  121.  
  122.      ----------------------------------------------------------------------
  123.                    F r o m   t h e   E d i t o r ' s   D e s k
  124.      ----------------------------------------------------------------------
  125.  
  126.      Is this Goodbye?
  127.      
  128.      As you may have noticed, this edition of The QBNews is not up to the
  129.      usual high standards set by previous issues. The problem is that I am
  130.      running out of people who I can hit up for free articles. Most of the
  131.      articles that have appeared in The QBNews were because of direct
  132.      solicitations from me. This issue relied on on contributions sent in
  133.      to me without my asking for them.
  134.      
  135.      For some reason, at least from the mail I have (or have not is more
  136.      like it) received, interest seems to be wanning in The QBNews. Because
  137.      of this, I have no choice but to suspend offering disk subscriptions
  138.      and as of right now, Volume 3 will be the end of The QBNews. The
  139.      months that passed since the 301 issue have really been disappointing
  140.      as far as response goes. I don't expect this issue to generate much
  141.      either because of how poor it is. However, I am committed to
  142.      continuing on until 304, and alot can happen in those six months. If
  143.      possible, I would like to continue producing The QBNews. However, that
  144.      means the term "user supported" will have to take on much more meaning
  145.      in the coming months
  146.      
  147.      Dave Cleary - Publisher of The QBNews
  148.      
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.      The QBNews                                                     Page  1
  177.      Volume  3, Number  2                                     June 29, 1992
  178.  
  179.  
  180.  
  181.      ----------------------------------------------------------------------
  182.                   D a t a B A S I C s   a n d   F i l e   I / O
  183.      ----------------------------------------------------------------------
  184.  
  185.      File Types 100 by Richard Vannoy
  186.      
  187.      This article will familiarize beginners to computer programming and
  188.      the QuickBASIC programming language with the basics of file creation
  189.      and a brief on the types of files generally used in computer programs.
  190.      First, we need a few definitions that describe how data is stored.
  191.      
  192.      Definitions:
  193.         Field:  A particular type of information in a file.
  194.                 Common field names would be phone number, name,
  195.                 address, or date.
  196.         Record: The sum of the fields for one person, place or
  197.                 thing.
  198.      
  199.         Field 1:     Name: Richard  <----- Together, these three
  200.         Field 2:    Phone: 777-1212 <-----   fields make one
  201.         Field 3: Birthday: 04\26\60 <-----     record.
  202.      
  203.      There are generally three types of files most commonly used today.
  204.      They are sequential, random access and binary.
  205.      
  206.      Sequential, as the name implies, means that data is written to the
  207.      file in sequence, or one after the other, so if I write the name and
  208.      phone numbers of a few friends in a sequential file, it might look
  209.      like the line below.  (The commas are called delimiters.  They are put
  210.      in by you or the program to separate each piece of data)
  211.      
  212.      Sam,777-5155,George,123-4567,Bill,323-1212
  213.      
  214.      Notice that all of the information (fields and records) are slammed
  215.      together and that there is no way to tell where the name Bill starts
  216.      without reading the file from the beginning.  To retrieve, or read the
  217.      items, we read them from the beginning, sequentially, until we get to
  218.      the information desired.  If Richard is the 100th name in the list, we
  219.      have to READ the first 99 names/phone numbers to get to it.
  220.      
  221.      In a random access file, the fields are defined to a specific length
  222.      and any spaces not used are filled with blanks.  This allows each
  223.      record to be the exact same size.  Like..
  224.      
  225.       Name: 10 bytes |Richard   |
  226.      Phone:  8 bytes |777-1212|
  227.      
  228.      Now we have a record length of 18 bytes, no matter how long the data
  229.      is, so lets write the same info as above to a file..
  230.      
  231.      Sam       777-5155George    123-4567Bill      323-1212
  232.      |                 |                 |
  233.      Note how a new record starts every 18 bytes, and that "unused" bytes
  234.      in the records are filled with spaces, so we can predict where every
  235.      
  236.      The QBNews                                                     Page  2
  237.      Volume  3, Number  2                                     June 29, 1992
  238.  
  239.      record is going to start.  And we don't need separaters since we know
  240.      exactly where each record and each field starts.  Not only that, if we
  241.      know that Richard's info is in the 100th record, we can go directly to
  242.      it since the record length is constant.  Because of this
  243.      predictability, which transforms to SPEED when it is time to find
  244.      information, random access records are well suited to storing and
  245.      retrieving large quantities of data.
  246.      
  247.      These are the two most common storage techniques, but there are many
  248.      more!  One, called Indexed Sequential Access Method (ISAM) is stored
  249.      somewha